prefix=/usr
USRBINDIR=$(DESTDIR)$(prefix)/bin

CPP = g++
CPPFLAGS =`pkg-config --cflags bluez` -Wall
LDFLAGS =`pkg-config --libs bluez`
INSTALL = install

SERVEROBJS = \
	blues.o \
	server.o

CLIENTOBJS = \
	blues.o \
	client.o

all: bt-example-server bt-example-client

bt-example-server: $(SERVEROBJS)
	$(CPP) -o $@ $(CPPFLAGS) $(LDFLAGS) $(SERVEROBJS)

bt-example-client: $(CLIENTOBJS)
	$(CPP) -o $@ $(CPPFLAGS) $(LDFLAGS) $(CLIENTOBJS)


clean:
	rm -f bt-example-server bt-example-client *.o *~ core *.core

install :
	$(INSTALL) -m 755 bt-example-server $(USRBINDIR)/bt-example-server
	$(INSTALL) -m 755 bt-example-client $(USRBINDIR)/bt-example-client
